<template>
  <div id="thaw">  
       <div  style="display:flex;margin-bottom:10px;align-items: center;">
            <img class="top_img" src="@/assets/images/a8.png" style="width:35px;height:35px;margin-right:10px;"/>
            <div style="line-height: 40px;font-weight:bold:">蜂巢售后</div>
     </div> 
      <el-form ref="form" :model="form" label-width="80px">  
     <el-row> 

        <el-col :span="20" style="display:flex;">

           <el-form-item label="" label-width="0px">
                <el-select  v-model="form.select_num" placeholder="请选择状态" style="width:160px;">
                    <el-option  v-for="(item,index) in select_data" :key="index" :label="item.name" :value="item.id"></el-option>
                </el-select>
            </el-form-item>

          <el-form-item label="" label-width="0px" style="margin-left:10px;">
                 <el-date-picker type="date"  placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"  v-model="form.time" style="width:160px;"></el-date-picker>
            </el-form-item>


            <el-form-item label-width="0px" style="margin-left:10px;">
               <el-input v-model="form.phone" placeholder="账户" style="width:160px;"></el-input>
            </el-form-item>


           <div class="custom_button2"  style="margin-left:10px;" @click="search_but"></div>
        </el-col>

         <el-col :span="4" style="text-align: right;">  
            <el-button type="primary" class="custom_color_button1" style="margin-bottom:10px;"  @click="refresh_but()">刷新</el-button>            
          </el-col>
    
    </el-row> 
   
   </el-form>

   <!-- 渲染数据list -->
   <thaw-list :thawdata="thawdata" @up_list_fun="list_fun"> </thaw-list>

      
   <div style="margin-top:20px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>

  

    

      
  </div>
</template>

<script>
import ThawList from '@/view/Aftersale/ThawList'
export default {
  name: 'thaw',
  data () {
    return {
        thawdata:[],
        page:1,
        count:0,
         form:{
          time:'',
          phone:'',
          select_num:''
        },
       select_data:[{"id":"2","name":"已拆分"},{"id":"1","name":"未拆分"},{"id":"3","name":"已驳回"}],
    }
  },
 components:{
    ThawList
  },
  created(){
     this.list_fun()
  },
  mounted (){
    
  },
  methods: {
      list_fun(){
          this.post("/goods_full/listOfData", {
              page:this.page,
              onetime:this.form.time,
              telphone:this.form.phone,
              type:this.form.select_num,
	        }).then(res => {
            this.count = res.result.count
            this.thawdata = res.result.list

            console.log(res)
         })
      },
      search_but(){
          this.page = 1
          this.list_fun()
      },
      refresh_but(){
           this.page = 1
           this.form={
              time:'',
              phone:'',
              select_num:''
            }
          this.list_fun()
      },
     handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.list_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>

</style>
